/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.xtd.model.inventory;

import com.xtd.model.retail.OrderDressSuit;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Collection;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author Lu Yuanbin
 */
@Entity
@Table(name = "dress_suit")
@NamedQueries({
    @NamedQuery(name = "DressSuit.findAll", query = "SELECT d FROM DressSuit d")})
public class DressSuit implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "id")
    private Integer id;
    @Column(name = "number")
    private String number;
    @Column(name = "name")
    private String name;
    @Column(name = "in_stock")
    private Short inStock;
    @Column(name = "rental")
    private BigDecimal rental;
    @Column(name = "cost")
    private BigDecimal cost;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "dressSuit")
    private Collection<OrderDressSuit> orderDressSuitCollection;

    public DressSuit() {
    }

    public DressSuit(Integer id) {
        this.id = id;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getNumber() {
        return number;
    }

    public void setNumber(String number) {
        this.number = number;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Short getInStock() {
        return inStock;
    }

    public void setInStock(Short inStock) {
        this.inStock = inStock;
    }

    public BigDecimal getRental() {
        return rental;
    }

    public void setRental(BigDecimal rental) {
        this.rental = rental;
    }

    public BigDecimal getCost() {
        return cost;
    }

    public void setCost(BigDecimal cost) {
        this.cost = cost;
    }

    public Collection<OrderDressSuit> getOrderDressSuitCollection() {
        return orderDressSuitCollection;
    }

    public void setOrderDressSuitCollection(Collection<OrderDressSuit> orderDressSuitCollection) {
        this.orderDressSuitCollection = orderDressSuitCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof DressSuit)) {
            return false;
        }
        DressSuit other = (DressSuit) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.xtd.model.DressSuit[id=" + id + "]";
    }

}
